#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
using namespace std;

int isPrime(int n)
{
    for (int i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return false;
    }
    return true;
}


int main()
{
    int n = 0;
    while (cin >> n) {
        for (int i = n / 2; i > 0; i--) {
            if (isPrime(i) && isPrime(n - i)) {
                cout << i << endl << n - i << endl;
                break;
            }
        }
    }
    return 0;
}